package JSE_04.Demo06;
// t0抢到cpu后睡眠了0.1毫秒，这时候ticket还没有减减，所以t2下面抢到后还是100.以此类推
public class Demo06 {
    public static void main(String[] args){
        new Thread(){
            @Override
            public void run(){
                for(int i=0;i<10;i++){
                    System.out.println(Thread.currentThread().getName()+"黑马"+i);
                }
            }
        }.start();

        Runnable r=new Runnable(){
            @Override
            public void run(){
                for (int i = 0; i < 10; i++) {
                    System.out.println(Thread.currentThread().getName()+"程序员"+i);
                }
            }
        };

        new Thread(r).start();
    }

}
